package com.ccyl.test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

//Test database connections.
public class test {
    public static void main(String[] args) {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            String url="jdbc:mysql://数据库id地址/qndxx?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC";
            String user="用户名";
            String password="密码";
            Connection connection= DriverManager.getConnection(url,user,password);
            System.out.println(connection);
        }
        catch (ClassNotFoundException e) {
            e.printStackTrace();
        }catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
